package com.ssm.supplier.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ssm.common.utils.PageUtils;
import com.ssm.common.utils.Query;
import com.ssm.supplier.dao.SsmSudetailsDao;
import com.ssm.supplier.entity.SsmSudetailsEntity;
import com.ssm.supplier.entity.vo.SudetailsDto;
import com.ssm.supplier.entity.vo.SuorderDto;
import com.ssm.supplier.entity.vo.SupplierGoodsVo;
import com.ssm.supplier.entity.vo.SupplierOrderDetailsVo;
import com.ssm.supplier.service.SsmSudetailsService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("ssmSudetailsService")
public class SsmSudetailsServiceImpl extends ServiceImpl<SsmSudetailsDao, SsmSudetailsEntity> implements SsmSudetailsService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SsmSudetailsEntity> page = this.page(
                new Query<SsmSudetailsEntity>().getPage(params),
                new QueryWrapper<SsmSudetailsEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<SudetailsDto> getorder(String id) {

        List<SudetailsDto> suorderEntity = baseMapper.selectdetail(id);
        return suorderEntity;
    }

    @Override
    public List<SupplierOrderDetailsVo> findSupplierDetailsById(String id) {
        return baseMapper.findSupplierDetailsById(id);
    }

    @Override
    public void deleteSuOrderInfoById(Integer id) {
        baseMapper.deleteSuOrderInfoById(id);
    }

    @Override
    public List<SupplierGoodsVo> findGoodsById(Integer id) {
        return baseMapper.findGoodsById(id);
    }



}